package com.xiaoshuidi.cloud.module.member.controller.admin.topics.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.xiaoshuidi.cloud.module.member.enums.topics.TopicsCommentReviewStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Schema(description = "管理后台 - 跟帖分页返回对象")
public class MemberTopicsPostListVo implements Serializable {
    private static final long serialVersionUID = -6141729046965269790L;

    @ExcelIgnore
    @Schema(description = "主键")
    private Long id;

    @ExcelIgnore
    @Schema(description = "话题ID")
    private Long topicId;

    @ExcelProperty("活动话题")
    @Schema(description = "话题名称")
    private String name;

    @ExcelProperty("发帖时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @Schema(description = "跟帖新增时间")
    private LocalDateTime createTime;

    @ExcelProperty("点赞数")
    @Schema(description = "点赞数")
    private Integer thumbs;

    @ExcelProperty("用户名称")
    @Schema(description = "用户名称")
    private String userName;

    @ExcelProperty("用户手机号")
    @Schema(description = "用户手机")
    private String mobile;

    @ExcelProperty("审核人")
    @Schema(description = "审核人")
    private String reviewer;

    @ExcelIgnore
    @Schema(description = "审核状态0-待审核,1-审核通过,2-审核不通过")
    private Integer reviewStatus;

    @ExcelProperty("审核状态")
    @Schema(description = "审核状态名称")
    private String reviewStatusName;

    @ExcelIgnore
    @Schema(description = "false-不隐藏,true-隐藏")
    private Boolean hide;

    @ExcelProperty("是否显示")
    private String hideOrShow;

    @ExcelIgnore
    @Schema(description = "是否推荐0-不推荐,1-推荐")
    private Boolean recommend;

    @ExcelProperty("是否推荐")
    private String recommendOrNot;

    @ExcelProperty("审核时间")
    @Schema(description = "审核时间")
    private LocalDateTime reviewTime;

    @ExcelIgnore
    @Schema(description = "参与内容")
    private String content;

    @ExcelIgnore
    @Schema(description = "附带图片")
    private String images;


    public String getReviewStatusName() {
        return TopicsCommentReviewStatusEnum.getNameByCode(reviewStatus);
    }

    public String getHideOrShow() {
        return hide ? "隐藏" : "显示";
    }

    public String getRecommendOrNot() {
        return recommend ? "是" : "否";
    }
}
